Update docopt to fix forwarding `--`
authorAlex Crichton <alex@alexcrichton.com>
Tue, 28 Jul 2015 01:08:28 +0000 (18:08 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 28 Jul 2015 01:08:28 +0000 (18:08 -0700)
Closes #1426

Cargo.lock
tests/test_cargo_run.rs

index 63a086d32b050bec08511b5b39a6d8c2399e3158..aeb60472a6a120f850dbf50b390d4b4d48cd1be9 100644 (file)
@@ -6,7 +6,7 @@ dependencies = [
  "bufstream 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "crates-io 0.1.0",
  "curl 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
- "docopt 0.6.67 (registry+https://github.com/rust-lang/crates.io-index)",
+ "docopt 0.6.69 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "filetime 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -93,7 +93,7 @@ dependencies = [
 
 [[package]]
 name = "docopt"
-version = "0.6.67"
+version = "0.6.69"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "regex 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)",
index d0f4945208bbaccd113ee301f35f6852f7e2c14f..7d17d384385074b03e59bd2e1d6a21be61d02535 100644 (file)
@@ -437,3 +437,27 @@ test!(run_bin_different_name {
 
     assert_that(p.cargo_process("run"), execs().with_status(0));
 });
+
+test!(dashes_are_forwarded {
+    let p = project("foo")
+        .file("Cargo.toml", r#"
+            [project]
+            name = "foo"
+            version = "0.0.1"
+            authors = []
+
+            [[bin]]
+            name = "bar"
+        "#)
+        .file("src/main.rs", r#"
+            fn main() {
+                let s: Vec<String> = std::env::args().collect();
+                assert_eq!(s[1], "a");
+                assert_eq!(s[2], "--");
+                assert_eq!(s[3], "b");
+            }
+        "#);
+
+    assert_that(p.cargo_process("run").arg("--").arg("a").arg("--").arg("b"),
+                execs().with_status(0));
+});